#include "contacts.pb.h"

int main()
{
    contacts::contact conn;
    conn.set_sn(100000);
    conn.set_name("张三");
    conn.set_score(90);

    std::string str = conn.SerializeAsString();

    contacts::contact stu;
    bool ret = stu.ParseFromString(str);
    if (ret == false)
    {
        std::cout << "反序列化失败！" << std::endl;
        return -1;
    }
    std::cout << stu.sn() << std::endl;
    std::cout << stu.name() << std::endl;
    std::cout << stu.score() << std::endl;

    return 0;
}